package com.zy.dp.chainofresponsibility.example3;

public class GeneralManager extends Handler
{

	@Override
	public String handleFeeRequest(String user, double fee)
	{
		String str = "";

		if (fee >= 1000)
		{

			if ("小李".equals(user))
			{
				str = "总经理同意" + user + "聚餐费用" + fee + "元的请求";
			}
			else
			{

				str = "总经理不同意" + user + "聚餐费用" + fee + "元的请求";
			}
			return str;
		}
		else
		{

			if (this.successor != null)
			{
				return successor.handleFeeRequest(user, fee);
			}
		}
		return str;
	}

	@Override
	public boolean handlePreFeeRequest(String user, double requestFee)
	{
		if (requestFee >= 20000)
		{

			System.out.println("总经理同意" + user + "预支差旅费用" + requestFee + "元的请求");
			return true;
		}
		else
		{

			if (this.successor != null)
			{
				return this.successor.handlePreFeeRequest(user, requestFee);
			}
		}
		return true;
	}

}
